#include "sdkGlobal.h"
#include "platform_global.h"

typedef struct {
    TransmitListener mTransmitListener;
    IsRecvComplete mIsRecvComplete;
}platform_byte_stream_entity;

static platform_byte_stream_entity g_platform_byte_stream_entity;

void platform_byte_stream_init()
{
    memset(&g_platform_byte_stream_entity, 0x00, sizeof(g_platform_byte_stream_entity));
}

void platform_byte_stream_set_transmit_listener(TransmitListener *listener)
{
    memcpy(&g_platform_byte_stream_entity.mTransmitListener, listener, sizeof(TransmitListener));
}

TransmitListener *platform_byte_stream_get_transmit_listener(void)
{
    return &g_platform_byte_stream_entity.mTransmitListener;
}

void platform_byte_stream_set_is_recv_complete_func(IsRecvComplete func)
{
    g_platform_byte_stream_entity.mIsRecvComplete = func;
}

IsRecvComplete platform_byte_stream_get_is_recv_complete_func(void)
{
    return g_platform_byte_stream_entity.mIsRecvComplete;
}
